﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--
    NEED TO OVERWRITE THE DEFAULT STYLE SO I GET SAFE ABOUT VISTA, XP, AND OTHER
    OPERATIONS SYSTEM DEFAULT FANCY STYLES
    -->
    <Style TargetType="TextBox">        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    
                
                        <Border 
                            
                        Name="Border"
                        CornerRadius="3" 
                        Margin="0"
                        Padding="2"                        
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"
                                      TextBlock.FontFamily="{TemplateBinding FontFamily}"
                                      TextBlock.FontSize="{TemplateBinding TextBox.FontSize}"/>
                        </Border>

                        
                    <ControlTemplate.Triggers>                                                
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{StaticResource HighLightBrush}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource HighLightBorderBrush}"/>
                            <Setter Property="TextBlock.Foreground" Value="{StaticResource DarkTextBrush}"/>
                        </Trigger>                  
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="Transparent"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderBrush" Value="Transparent"/>
                            <!--<Setter TargetName="Border" Property="BorderBrush" Value="{TemplateBinding BorderBrush}"/>-->
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <!--<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>-->
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                        
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>


    <Style x:Key="FormTextBox" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}" >                
        <Setter Property="FontFamily" Value="{StaticResource BasicFont}"/>
        <Setter Property="FontSize" Value="{StaticResource BasicFontSize}"/>
        <Setter Property="Margin" Value="2,2,2,2"/>        
        <Setter Property="Background" Value="{StaticResource FormInputBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource FormInputBorderBrush}"/>        
        <Setter Property="BorderThickness" Value="1,1,1,1"/>
        <Setter Property="VerticalAlignment"  Value="Center"/>
        <Style.Triggers>        
            <Trigger Property="Validation.HasError" Value="True">
                <Setter Property="TextBox.ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
                <Setter Property="TextBox.Background" Value="{StaticResource FormErrorBrush}"/>
            </Trigger>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="Background" Value="White"/>
                <Setter Property="Foreground" Value="Black"/>
                <Setter Property="BorderBrush" Value="{StaticResource NormalBrush}"/>
            </Trigger>
            <Trigger Property="IsReadOnly" Value="True">
                <Setter Property="TextWrapping" Value="Wrap"/>
                <Setter Property="BorderBrush" Value="{StaticResource FormInputBorderBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="LabelInfo" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="FontFamily" Value="{StaticResource BasicFont}"/>
        <Setter Property="FontSize" Value="{StaticResource BasicFontSize}"/>
        <Setter Property="Margin" Value="2,2,2,2"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1,1,1,1"/>
        <Setter Property="VerticalAlignment"  Value="Center"/>
        <Setter Property="IsReadOnly"  Value="True"/>
    </Style>

    <Style x:Key="DetailTextBox" TargetType="TextBox" BasedOn="{StaticResource FormTextBox}" >
        
    </Style>

    <Style x:Key="FilterTextBox" TargetType="TextBox" BasedOn="{StaticResource FormTextBox}">        
        <Setter Property="FontSize" Value="{StaticResource NeedToSeeFontSize}"/>
        <Setter Property="Foreground" Value="{StaticResource DarkTextBrush}"/>        
        <Setter Property="Background" Value="{StaticResource FilterTextBoxActiveBrush}"/>                
        <Style.Triggers>
            <Trigger Property="Text" Value="">
                <Setter Property="Background" Value="{StaticResource FormInputBackgroundBrush}"/>                
            </Trigger>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="Background" Value="{StaticResource FilterTextBoxActiveBrush}"/>
                <Setter Property="Foreground" Value="{StaticResource DarkTextBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>


</ResourceDictionary>